package com.ruoyi.test.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.test.domain.Movie;
import com.ruoyi.test.domain.vo.CinemaMovieVo;
import com.ruoyi.test.service.MovieService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/movie")
public class MovieControl extends BaseController {

    @Autowired
    private MovieService movieService;

    // 分页查询影院
    // 这里的参数表示前端传过来的值,可以自定义vo
    @RequestMapping("/queryMoviePageByCinemaId")
    public TableDataInfo queryMoviePageByCinemaId(CinemaMovieVo cinemaMovieVo){
        startPage();
        // 这里的list表示后端要传给前端的值,即查询到的数据,必须得是一个实体类
        List<Movie> list = movieService.queryMoviePageByCinemaId(cinemaMovieVo);

        return getDataTable(list);
    }
}
